/****************************************
* TABLE A10: Staff Educational Background
****************************************/
* house
clear
use masterdata_house1.dta
keep if totworkdays > 180
gen female = 0
replace female = 1 if gender =="F"
by core_person_id, sort: gen tt = 1 if _n == 1
sum degreeinfo if tt ==1 & dem == 1
sum degreeinfo if tt ==1 & dem == 0
sum degreeinfo if tt ==1 & dem == 1 & female ==1
sum degreeinfo if tt ==1 & dem == 0 & female ==1
sum degreeinfo if tt ==1 & dem == 1 & female ==0
sum degreeinfo if tt ==1 & dem == 0 & female ==0
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 & female ==1
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 & female ==1
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 & female ==0
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 & female ==0

* senate
clear
use masterdata_senate1.dta
keep if totworkdays > 180
gen female = 0
replace female = 1 if gender =="F"
by core_person_id, sort: gen tt = 1 if _n == 1
sum degreeinfo if tt ==1 & dem == 1
sum degreeinfo if tt ==1 & dem == 0
sum degreeinfo if tt ==1 & dem == 1 & female ==1
sum degreeinfo if tt ==1 & dem == 0 & female ==1
sum degreeinfo if tt ==1 & dem == 1 & female ==0
sum degreeinfo if tt ==1 & dem == 0 & female ==0
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 & female ==1
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 & female ==1
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 1 & female ==0
sum grad_degree jdphd eliteuniv if tt ==1 & dem == 0 & female ==0

